<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
   <title>FishVideo</title>
   <link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
   <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
   <script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
</head>
<style>
	#bodycontent{
		width:100%;
	}
	#left{
		width:15%;
		height:100%;
		margin-left:0%;
	}
	#right{
		width:70%;
		margin-left:30%;
	}
</style>
<body>
   <nav class="navbar navbar-inverse" role="navigation">
   <div class="navbar-header">
      <a class="navbar-brand" href="#">FishVideo</a>
   </div>
   <div>
      <ul class="nav navbar-nav">
         <li ><a href="../index.html">首页</a></li>
      </ul>
   </div>
     
	 <ul class="nav navbar-nav navbar-right">
           <form   action="#" class="navbar-form navbar-left" role="search" >
        <div class="form-group">
          <input type="text" class="form-control"  name="videoname" placeholder="搜索">
        </div>
        <button type="submit" class="btn btn-default">搜索</button>
      </form>
     </ul>
</nav>
<div id="bodycontent">
	<div class="container" id=left>
	<div class="row">
		<div class="span2">
			<ul class="nav nav-tabs nav-stacked">
				<li><a href="#">个人信息</a></li>   
				<li><a href="#">观看记录</a></li>
				<li><a href="#">我的评论</a></li> 
			</ul>
		</div>
	</div>
	</div>
	<div id="right">
	<table class="table">
		<?php
		require_once("../tools/con_mysql_set.php");//链接信息
			define("TABLENAME","fishvideo_users");
			$link=mysql_connect(HOSTNAME,USERNAME,PASSWORD);
			if(!$link){
				echo "链接失败!"."<br>";
				exit();
			}
				mysql_query("set names 'utf8'");//设置查询出来的数据编码名称
				$sql="select * from ".TABLENAME." where yjl_uname='{$_POST['user']}'"; 				
				mysql_select_db(DATABASE,$link)or die("不能选择数据库".TABLENAME.":".mysql_error);
				$result = mysql_query($sql);
				
			//解析
			$arr=array("yjl_uname","yjl_sex","yjl_birthdate","yjl_hobby","yjl_degree","yjl_intro","yjl_pic");
			$arrName=array("姓名","性别","生日","爱好","学历","自我评价","照片");
			$row = mysql_fetch_array($result);//得到每一列的结果
			for($i=0;$i<count($arr);$i++){
				$prit=$row[$arr[$i]];
				if(1==$i){
					if($prit==1){
						$prit="男";
					}else{
						$prit="女";
					}
				}
				if(4==$i){
					switch($prit){
						case 0:$prit="高中";break;
						case 1:$prit="大学";break;
						case 2:$prit="研究生";break;
						case 3:$prit="博士";break;
					default:
						$prit="其他学历";
					}
				}
				echo "<tr><th>{$arrName[$i]}</th><td>{$prit}</td>";
				mysql_close($link);
			}			
		?>
	</div>
</div>
</body>
</html>